import * as echarts from 'echarts'
import * as ywApi from './request'

export default {
    data() {
        return {
            colors: ["#009dff", '#ff5422', '#ff9e22', '#04e38a'],
            form: {
                tjqj: [],
                tjqjHistory: [],
                tjqjToday: [],
            },

            loading_wgla: false,
            loading_yabs: false,
            loading_wggw: false,
            loading_tyzx: false,
            loading_wgjjz: false,

            kt2_sum: 0,
            kt2_wgla: 0,

            loading_yabl: false,
            loading_ycsx: false,
            loading_tswg: false,
            loading_xssc: false,
            loading_slcq: false,
            loading_zxcq: false,
            loading_wgzx: false,

            kt3_yabl: 0,
            kt3_ycsx: 0,
            kt3_tswg: 0,
            kt3_xssc: 0,
            kt3_slcq: 0,
            kt3_zxcq: 0,
            kt3_wgzx: 0,

            echart_wgla: null,
            echart_yabs: null,
            echart_wggw: null,
            echart_tyzx: null,
            echart_wgjjz: null,

            echart_wgla_data: [
                {
                    value: 0,
                    name: '0件',
                    title: {
                        offsetCenter: ['0%', '-10%']
                    },
                    detail: {
                        valueAnimation: true,
                        offsetCenter: ['0%', '30%']
                    },
                    itemStyle: {
                        color: 'rgb(91, 173, 71)' // 为数据点设置固定颜色
                    }
                },
            ],
            echart_yabs_data: [
                {
                    value: 0,
                    name: '0件',
                    title: {
                        offsetCenter: ['0%', '-10%']
                    },
                    detail: {
                        valueAnimation: true,
                        offsetCenter: ['0%', '30%']
                    },
                    itemStyle: {
                        color: 'rgb(0, 157, 255)' // 为数据点设置固定颜色
                    }
                },
            ],
            echart_wggw_data: [
                {
                    value: 0,
                    name: '0件',
                    title: {
                        offsetCenter: ['0%', '-10%']
                    },
                    detail: {
                        valueAnimation: true,
                        offsetCenter: ['0%', '30%']
                    },
                    itemStyle: {
                        color: 'rgb(26, 104, 153)' // 为数据点设置固定颜色
                    }
                },
            ],
            echart_tyzx_data: [
                {
                    value: 0,
                    name: '0件',
                    title: {
                        offsetCenter: ['0%', '-10%']
                    },
                    detail: {
                        valueAnimation: true,
                        offsetCenter: ['0%', '30%']
                    },
                    itemStyle: {
                        color: 'rgb(255, 172, 0)' // 为数据点设置固定颜色
                    }
                },
            ],
            echart_wgjjz_data: [
                {
                    value: 0,
                    name: '0件',
                    title: {
                        offsetCenter: ['0%', '-10%']
                    },
                    detail: {
                        valueAnimation: true,
                        offsetCenter: ['0%', '30%']
                    },
                    itemStyle: {
                        color: 'rgb(90, 213, 51)' // 为数据点设置固定颜色
                    }
                },
            ],

            hiddenAddCaseList:[],
            loading_jrzl_aj: false,
            loading_jrzl_aj_g: false,
            loading_jrzl_aj_z: false,
            loading_jrzl_aj_d: false,
            jrzl_aj: 0,
            jrzl_aj_g: 0,
            jrzl_aj_z: 0,
            jrzl_aj_d: 0,
            jrzl_ajfxs: [],

            loading_jrzl_ry: false,
            loading_jrzl_ry_g: false,
            loading_jrzl_ry_z: false,
            loading_jrzl_ry_d: false,
            jrzl_ry: 0,
            jrzl_ry_g: 0,
            jrzl_ry_z: 0,
            jrzl_ry_d: 0,
            jrzl_ryfxs: [],

            loading_ajfxtj_1: false,
            echart_fxtj_1: null,
            echart_fxtj_1_mcs: [],
            echart_fxtj_1_counts: [],
            loading_ajfxtj_2: false,
            echart_fxtj_2: null,
            echart_fxtj_2_mcs: [],
            echart_fxtj_2_counts: [],

            xxyjList: [
                {ah: '2024）湘民初5214号', clyj: '处理意见处理意见', yjly: '意见来源意见来源意见来源'}
                , {ah: '2024）湘民初5214号', clyj: '处理意见处理意见', yjly: '意见来源意见来源意见来源'}
                , {ah: '2024）湘民初5214号', clyj: '处理意见处理意见', yjly: '意见来源意见来源意见来源'}
                , {ah: '2024）湘民初5214号', clyj: '处理意见处理意见', yjly: '意见来源意见来源意见来源'}
                , {ah: '2024）湘民初5214号', clyj: '处理意见处理意见', yjly: '意见来源意见来源意见来源'}
            ],
            pagination: {
                currentPage: 1,
                pageSizes: [
                    10,
                    20,
                    30,
                    50
                ],
                pageSize: 10,
                total: 0
            },

            loading_zyajjd: false,
            echart_zyajjd: null,
            echart_zyajjd_mcs: [],
            echart_zyajjd_counts: [],

            loading_zyjdjd: false,
            echart_zyjdjd: null,
            echart_zyjdjd_mcs: [],
            echart_zyjdjd_counts: [],

            loading_lajh: false,
            echart_lajh: null,
            echart_lajh_times: [],
            echart_lajh_counts: [],
            echart_lajh_datas: [],

        }
    },
    methods: {
        reloadPage() {
            var _this = this
            window.onresize = () => {
                return (() => {
                    if (_this.echart_wgla) {
                        _this.echart_wgla.resize()
                    }
                    if (_this.echart_yabs) {
                        _this.echart_yabs.resize()
                    }
                    if (_this.echart_wggw) {
                        _this.echart_wggw.resize()
                    }
                    if (_this.echart_tyzx) {
                        _this.echart_tyzx.resize()
                    }
                    if (_this.echart_wgjjz) {
                        _this.echart_wgjjz.resize()
                    }
                    if (_this.echart_fxtj_1) {
                        _this.echart_fxtj_1.resize()
                    }
                    if (_this.echart_fxtj_2) {
                        _this.echart_fxtj_2.resize()
                    }
                    if (_this.echart_zyajjd) {
                        _this.echart_zyajjd.resize()
                    }
                    if (_this.echart_zyjdjd) {
                        _this.echart_zyjdjd.resize()
                    }
                })()
            }
            window.onunload = () => {
                return (() => {
                })()
            }
        },
        initChart_wgla() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            _this.echart_wgla = null;
            _this.echart_wgla = echarts.init(document.getElementById('echart_wgla'))

            // 绘制图表
            _this.echart_wgla.setOption({
                title: {
                    text: '违规立案',
                    left: 'center',
                    top: '85%',
                    textStyle: {
                        fontSize: 14,
                        color: '#333'
                    }
                },
                series: [
                    {
                        type: 'gauge',
                        startAngle: 90,
                        endAngle: -270,
                        pointer: {
                            show: false
                        },
                        progress: {
                            show: true,
                            overlap: false,
                            roundCap: true,
                            clip: false,
                            itemStyle: {
                                borderWidth: 1,
                                borderColor: '#464646'
                            }
                        },
                        axisLine: {
                            lineStyle: {
                                width: 5,
                            }
                        },
                        splitLine: {
                            show: false,
                            distance: 0,
                            length: 10
                        },
                        axisTick: {
                            show: false
                        },
                        axisLabel: {
                            show: false,
                            distance: 50
                        },
                        data: this.echart_wgla_data,
                        title: {
                            fontSize: 13
                        },
                        detail: {
                            width: '90%',
                            height: '10%',
                            fontSize: 13,
                            //color: 'inherit',
                            //borderColor: 'inherit',
                            //borderRadius: 20,
                            //borderWidth: 1,
                            formatter: '{value}%'
                        }
                    }
                ]
            })
            this.loading_wgla = false
        },
        initChart_yabs() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            _this.echart_yabs = null;
            _this.echart_yabs = echarts.init(document.getElementById('echart_yabs'))

            // 绘制图表
            _this.echart_yabs.setOption({
                title: {
                    text: '压案不审',
                    left: 'center',
                    top: '85%',
                    textStyle: {
                        fontSize: 14,
                        color: '#333'
                    }
                },
                series: [
                    {
                        type: 'gauge',
                        startAngle: 90,
                        endAngle: -270,
                        pointer: {
                            show: false
                        },
                        progress: {
                            show: true,
                            overlap: false,
                            roundCap: true,
                            clip: false,
                            itemStyle: {
                                borderWidth: 1,
                                borderColor: '#464646'
                            }
                        },
                        axisLine: {
                            lineStyle: {
                                width: 5,
                            }
                        },
                        splitLine: {
                            show: false,
                            distance: 0,
                            length: 10
                        },
                        axisTick: {
                            show: false
                        },
                        axisLabel: {
                            show: false,
                            distance: 50
                        },
                        data: this.echart_yabs_data,
                        title: {
                            fontSize: 13
                        },
                        detail: {
                            width: '90%',
                            height: '10%',
                            fontSize: 13,
                            //color: 'inherit',
                            //borderColor: 'inherit',
                            //borderRadius: 20,
                            //borderWidth: 1,
                            formatter: '{value}%'
                        }
                    }
                ]
            })
            this.loading_yabs = false
        },
        initChart_wggw() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            _this.echart_wggw = null;
            _this.echart_wggw = echarts.init(document.getElementById('echart_wggw'))

            // 绘制图表
            _this.echart_wggw.setOption({
                title: {
                    text: '违规过问',
                    left: 'center',
                    top: '85%',
                    textStyle: {
                        fontSize: 14,
                        color: '#333'
                    }
                },
                series: [
                    {
                        type: 'gauge',
                        startAngle: 90,
                        endAngle: -270,
                        pointer: {
                            show: false
                        },
                        progress: {
                            show: true,
                            overlap: false,
                            roundCap: true,
                            clip: false,
                            itemStyle: {
                                borderWidth: 1,
                                borderColor: '#464646'
                            }
                        },
                        axisLine: {
                            lineStyle: {
                                width: 5,
                            }
                        },
                        splitLine: {
                            show: false,
                            distance: 0,
                            length: 10
                        },
                        axisTick: {
                            show: false
                        },
                        axisLabel: {
                            show: false,
                            distance: 50
                        },
                        data: this.echart_wggw_data,
                        title: {
                            fontSize: 13
                        },
                        detail: {
                            width: '90%',
                            height: '10%',
                            fontSize: 13,
                            //color: 'inherit',
                            //borderColor: 'inherit',
                            //borderRadius: 20,
                            //borderWidth: 1,
                            formatter: '{value}%'
                        }
                    }
                ]
            })

            this.loading_wggw = false
        },
        initChart_tyzx() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            _this.echart_tyzx = null;
            _this.echart_tyzx = echarts.init(document.getElementById('echart_tyzx'))

            // 绘制图表
            _this.echart_tyzx.setOption({
                title: {
                    text: '拖延执行',
                    left: 'center',
                    top: '85%',
                    textStyle: {
                        fontSize: 14,
                        color: '#333'
                    }
                },
                series: [
                    {
                        type: 'gauge',
                        startAngle: 90,
                        endAngle: -270,
                        pointer: {
                            show: false
                        },
                        progress: {
                            show: true,
                            overlap: false,
                            roundCap: true,
                            clip: false,
                            itemStyle: {
                                borderWidth: 1,
                                borderColor: '#464646'
                            }
                        },
                        axisLine: {
                            lineStyle: {
                                width: 5,
                            }
                        },
                        splitLine: {
                            show: false,
                            distance: 0,
                            length: 10
                        },
                        axisTick: {
                            show: false
                        },
                        axisLabel: {
                            show: false,
                            distance: 50
                        },
                        data: this.echart_tyzx_data,
                        title: {
                            fontSize: 13
                        },
                        detail: {
                            width: '90%',
                            height: '10%',
                            fontSize: 13,
                            //color: 'inherit',
                            //borderColor: 'inherit',
                            //borderRadius: 20,
                            //borderWidth: 1,
                            formatter: '{value}%'
                        }
                    }
                ]
            })

            this.loading_tyzx = false
        },
        initChart_wgjjz() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            _this.echart_wgjjz = null;
            _this.echart_wgjjz = echarts.init(document.getElementById('echart_wgjjz'))

            // 绘制图表
            _this.echart_wgjjz.setOption({
                title: {
                    text: '违规减假暂',
                    left: 'center',
                    top: '85%',
                    textStyle: {
                        fontSize: 14,
                        color: '#333'
                    }
                },
                series: [
                    {
                        type: 'gauge',
                        startAngle: 90,
                        endAngle: -270,
                        pointer: {
                            show: false
                        },
                        progress: {
                            show: true,
                            overlap: false,
                            roundCap: true,
                            clip: false,
                            itemStyle: {
                                borderWidth: 1,
                                borderColor: '#464646'
                            }
                        },
                        axisLine: {
                            lineStyle: {
                                width: 5,
                            }
                        },
                        splitLine: {
                            show: false,
                            distance: 0,
                            length: 10
                        },
                        axisTick: {
                            show: false
                        },
                        axisLabel: {
                            show: false,
                            distance: 50
                        },
                        data: this.echart_wgjjz_data,
                        title: {
                            fontSize: 13
                        },
                        detail: {
                            width: '90%',
                            height: '10%',
                            fontSize: 13,
                            //color: 'inherit',
                            //borderColor: 'inherit',
                            //borderRadius: 20,
                            //borderWidth: 1,
                            formatter: '{value}%'
                        }
                    }
                ]
            })

            this.loading_wgjjz = false
        },
        initCharts_fxtj_1() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            this.echart_fxtj_1 = null;
            this.echart_fxtj_1 = echarts.init(document.getElementById('echart_fxtj_1'))

            // 绘制图表
            // 绘制图表
            this.echart_fxtj_1.setOption({
                backgroundColor: "transparent",
                grid: {
                    left: '8%',
                    right: '8%',
                    top: '8%',
                    bottom: '8%',
                    containLabel: true
                },
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "shadow",
                        textStyle: {
                            color: "#323232"
                        }
                    },
                },
                xAxis: {
                    type: 'category',
                    data: this.echart_fxtj_1_mcs,
                },
                yAxis: {
                    type: 'value',
                },
                series: [
                    {
                        type: 'bar',
                        barWidth: '20',
                        data: this.echart_fxtj_1_counts,
                        itemStyle: {
                            color: 'rgb(65, 221, 234)'
                        },
                    }]
            })
        },
        initCharts_fxtj_2() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            this.echart_fxtj_2 = null;
            this.echart_fxtj_2 = echarts.init(document.getElementById('echart_fxtj_2'))

            // 绘制图表
            // 绘制图表
            this.echart_fxtj_2.setOption({
                backgroundColor: "transparent",
                grid: {
                    left: '8%',
                    right: '8%',
                    top: '8%',
                    bottom: '8%',
                    containLabel: true
                },
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "shadow",
                        textStyle: {
                            color: "#323232"
                        }
                    },
                },
                xAxis: {
                    type: 'category',
                    data: this.echart_fxtj_2_mcs,
                },
                yAxis: {
                    type: 'value',
                },
                series: [
                    {
                        type: 'bar',
                        barWidth: '20',
                        data: this.echart_fxtj_2_counts,
                        itemStyle: {
                            color: 'rgb(255, 150, 14)'
                        },
                    }]
            })
        },
        initCharts_zyajjd() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            this.echart_zyajjd = null;
            this.echart_zyajjd = echarts.init(document.getElementById('echart_zyajjd'))

            // 绘制图表
            this.echart_zyajjd.setOption({
                backgroundColor: "transparent",
                grid: {
                    left: '8%',
                    right: '8%',
                    top: '8%',
                    bottom: '8%',
                    containLabel: true
                },
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "shadow",
                        textStyle: {
                            color: "#323232"
                        }
                    },
                },
                xAxis: {
                    type: 'value',
                },
                yAxis: {
                    type: 'category',
                    data: this.echart_zyajjd_mcs,
                    inverse: true,
                },
                series: [
                    {
                        type: 'bar',
                        barWidth: '20',
                        data: this.echart_zyajjd_counts,
                        itemStyle: {
                            color: 'rgb(0, 186, 255)'
                        },
                        label: {
                            show: true,
                            position: 'right',
                        }
                    },
                ]
            })
        },
        initCharts_zyjdjd() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            this.echart_zyjdjd = null;
            this.echart_zyjdjd = echarts.init(document.getElementById('echart_zyjdjd'))

            // 绘制图表
            this.echart_zyjdjd.setOption({
                backgroundColor: "transparent",
                grid: {
                    left: '8%',
                    right: '8%',
                    top: '8%',
                    bottom: '8%',
                    containLabel: true
                },
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "shadow",
                        textStyle: {
                            color: "#323232"
                        }
                    },
                },
                xAxis: {
                    type: 'value',
                },
                yAxis: {
                    type: 'category',
                    data: this.echart_zyjdjd_mcs,
                    inverse: true,
                },
                series: [
                    {
                        type: 'bar',
                        barWidth: '20',
                        data: this.echart_zyjdjd_counts,
                        itemStyle: {
                            color: 'rgb(255, 150, 14)'
                        },
                        label: {
                            show: true,
                            position: 'right',
                        }
                    },
                ]
            })
        },
        //-------------------------------------------------------------------------------------查询-分页
        handleSizeChange(val) {
            this.pagination.pageSize = val
            this.pagination.currentPage = 1
            //this.getFxAjByFyBh()
        },
        handleCurrentChange(val) {
            this.pagination.currentPage = val
            //this.getFxAjByFyBh()
        },
        //行号
        getIndex(index) {
            return (this.pagination.currentPage - 1) * this.pagination.pageSize + (index + 1)
        },
        //-----------------------------------------------------------------------------------------获取重大事件监督
        getZdsjjdSum() {
            this.loading_wgla = true
            this.loading_yabs = true
            this.loading_yggw = true
            this.loading_tyzx = true
            this.loading_wgjjz = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqj
            params.c_ktbh = [2]
            params.risk_reason20 = 1
            ywApi.getAjsl(params).then((res) => {
                console.log('getAjsl=', res)
                this.kt2_sum = res.n_fxCount
                this.cl_wgla('002001')
                this.cl_yabs('002002')
                this.cl_wggw('002003')
                this.cl_tyzx('002004')
                this.cl_wgjjz('002005')
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_wgla = false
                this.loading_yabs = false
                this.loading_yggw = false
                this.loading_tyzx = false
                this.loading_wgjjz = false
            })
        },
        //违规立案
        cl_wgla(fxlb) {
            if (this.kt2_sum == 0) {
                this.echart_wgla_data[0].name = 0 + '件';
                this.echart_wgla_data[0].value = 0;
                this.initChart_wgla()
            } else {
                var _this = this
                var params = {}
                params.tjqj = this.form.tjqj
                params.c_ktbh = [2]
                params.c_fxlb = fxlb
                params.risk_reason21 = 1
                ywApi.getAjsl(params).then((res) => {
                    console.log('getZdsjjd_wgla=', res)
                    if (res.n_fxCount == 0) {
                        this.echart_wgla_data[0].name = 0 + '件';
                        this.echart_wgla_data[0].value = 0;
                    } else {
                        this.echart_wgla_data[0].name = res.n_fxCount + '件';
                        this.echart_wgla_data[0].value = (res.n_fxCount * 100 / this.kt2_sum).toFixed(2);
                    }
                    this.initChart_wgla()
                }).catch((err) => {
                    this.$message({
                        type: 'error',
                        message: err
                    })
                    this.loading_wgla = false
                })
            }
        },
        cl_yabs(fxlb) {
            if (this.kt2_sum == 0) {
                this.echart_yabs_data[0].name = 0 + '件';
                this.echart_yabs_data[0].value = 0;
                this.initChart_yabs()
            } else {
                var _this = this
                var params = {}
                params.tjqj = this.form.tjqj
                params.c_ktbh = [2]
                params.c_fxlb = fxlb
                params.risk_reason22 = 1
                ywApi.getAjsl(params).then((res) => {
                    console.log('getZdsjjd_yabs=', res)
                    if (res.n_fxCount == 0) {
                        this.echart_yabs_data[0].name = 0 + '件';
                        this.echart_yabs_data[0].value = 0;
                    } else {
                        this.echart_yabs_data[0].name = res.n_fxCount + '件';
                        this.echart_yabs_data[0].value = (res.n_fxCount * 100 / this.kt2_sum).toFixed(2);
                    }
                    this.initChart_yabs()
                }).catch((err) => {
                    this.$message({
                        type: 'error',
                        message: err
                    })
                    this.loading_yabs = false
                })
            }
        },
        cl_wggw(fxlb) {
            if (this.kt2_sum == 0) {
                this.echart_wggw_data[0].name = 0 + '件';
                this.echart_wggw_data[0].value = 0;
                this.initChart_wggw()
            } else {
                var _this = this
                var params = {}
                params.tjqj = this.form.tjqj
                params.c_ktbh = [2]
                params.c_fxlb = fxlb
                params.risk_reason23 = 1
                ywApi.getAjsl(params).then((res) => {
                    console.log('getZdsjjd_wggw=', res)
                    if (res.n_fxCount == 0) {
                        this.echart_wggw_data[0].name = 0 + '件';
                        this.echart_wggw_data[0].value = 0;
                    } else {
                        this.echart_wggw_data[0].name = res.n_fxCount + '件';
                        this.echart_wggw_data[0].value = (res.n_fxCount * 100 / this.kt2_sum).toFixed(2);
                    }
                    this.initChart_wggw()
                }).catch((err) => {
                    this.$message({
                        type: 'error',
                        message: err
                    })
                    this.loading_wggw = false
                })
            }
        },
        cl_tyzx(fxlb) {
            if (this.kt2_sum == 0) {
                this.echart_tyzx_data[0].name = 0 + '件';
                this.echart_tyzx_data[0].value = 0;
                this.initChart_tyzx()
            } else {
                var _this = this
                var params = {}
                params.tjqj = this.form.tjqj
                params.c_ktbh = [2]
                params.c_fxlb = fxlb
                params.risk_reason24 = 1
                ywApi.getAjsl(params).then((res) => {
                    console.log('getZdsjjd_tyzx=', res)
                    if (res.n_fxCount == 0) {
                        this.echart_tyzx_data[0].name = 0 + '件';
                        this.echart_tyzx_data[0].value = 0;
                    } else {
                        this.echart_tyzx_data[0].name = res.n_fxCount + '件';
                        this.echart_tyzx_data[0].value = (res.n_fxCount * 100 / this.kt2_sum).toFixed(2);
                    }
                    this.initChart_tyzx()
                }).catch((err) => {
                    this.$message({
                        type: 'error',
                        message: err
                    })
                    this.loading_tyzx = false
                })
            }
        },
        cl_wgjjz(fxlb) {
            if (this.kt2_sum == 0) {
                this.echart_wgjjz_data[0].name = 0 + '件';
                this.echart_wgjjz_data[0].value = 0;
                this.initChart_wgjjz()
            } else {
                var _this = this
                var params = {}
                params.tjqj = this.form.tjqj
                params.c_ktbh = [2]
                params.c_fxlb = fxlb
                params.risk_reason25 = 1
                ywApi.getAjsl(params).then((res) => {
                    console.log('getZdsjjd_wgjjz=', res)
                    if (res.n_fxCount == 0) {
                        this.echart_wgjjz_data[0].name = 0 + '件';
                        this.echart_wgjjz_data[0].value = 0;
                    } else {
                        this.echart_wgjjz_data[0].name = res.n_fxCount + '件';
                        this.echart_wgjjz_data[0].value = (res.n_fxCount * 100 / this.kt2_sum).toFixed(2);
                    }
                    this.initChart_wgjjz()
                }).catch((err) => {
                    this.$message({
                        type: 'error',
                        message: err
                    })
                    this.loading_wgjjz = false
                })
            }
        },
        //-----------------------------------------------------------------------------------------今日总览
        getTodayAj() {
            this.loading_jrzl_aj = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [1, 2, 3]
            ywApi.getAjsl(params).then((res) => {
                console.log('getTodayAj=', res)
                this.jrzl_aj = res.n_fxCount
                this.hiddenAddCaseList = res.caseIdList
                this.jrzl_ajfxs = this.jrzl_aj.toString().split('').map(Number)
                this.loading_jrzl_aj = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_aj = false
            })
        },
        goToChoseCase(){
            console.log(this.hiddenAddCaseList)
            localStorage.setItem("clickList",JSON.stringify(this.hiddenAddCaseList))
            this.$router.push({
                path: 'caseRiskIndex1'
            });
        },
        getTodayAj_g() {
            this.loading_jrzl_aj_g = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [1, 2, 3]
            params.fzList = [81, 100]
            ywApi.getAjsl(params).then((res) => {
                console.log('getTodayAj_g=', res)
                this.jrzl_aj_g = res.n_fxCount
                this.loading_jrzl_aj_g = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_aj_g = false
            })
        },
        getTodayAj_z() {
            this.loading_jrzl_aj_z = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [1, 2, 3]
            params.fzList = [41, 60]
            ywApi.getAjsl(params).then((res) => {
                console.log('getTodayAj_z=', res)
                this.jrzl_aj_z = res.n_fxCount
                this.loading_jrzl_aj_z = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_aj_z = false
            })
        },
        getTodayAj_d() {
            this.loading_jrzl_aj_d = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [1, 2, 3]
            params.fzList = [1, 20]
            ywApi.getAjsl(params).then((res) => {
                console.log('getTodayAj_d=', res)
                this.jrzl_aj_d = res.n_fxCount
                this.loading_jrzl_aj_d = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_aj_d = false
            })
        },
        getTodayRy() {
            this.loading_jrzl_ry = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [4]
            ywApi.getRysl(params).then((res) => {
                console.log('getRysl=', res)
                this.jrzl_ry = res.n_fxCount
                this.jrzl_ryfxs = this.jrzl_ry.toString().split('').map(Number)
                this.loading_jrzl_ry = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_ry = false
            })
        },
        getTodayRy_g() {
            this.loading_jrzl_ry_g = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [4]
            params.fzList = [81, 100]
            ywApi.getRysl(params).then((res) => {
                console.log('getTodayRy_g=', res)
                this.jrzl_ry_g = res.n_fxCount
                this.loading_jrzl_ry_g = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_ry_g = false
            })
        },
        getTodayRy_z() {
            this.loading_jrzl_ry_z = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [4]
            params.fzList = [41, 60]
            ywApi.getRysl(params).then((res) => {
                console.log('getTodayRy_z=', res)
                this.jrzl_ry_z = res.n_fxCount
                this.loading_jrzl_ry_z = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_ry_z = false
            })
        },
        getTodayRy_d() {
            this.loading_jrzl_ry_d = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqjToday
            params.c_ktbh = [4]
            params.fzList = [1, 20]
            ywApi.getRysl(params).then((res) => {
                console.log('ggetTodayRy_d=', res)
                this.jrzl_ry_d = res.n_fxCount
                this.loading_jrzl_ry_d = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_jrzl_ry_d = false
            })
        },
        //-----------------------------------------------------------------------------------------获取重大事件监督
        getZyjdjd() {
            this.loading_zyjdjd = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqj
            params.c_ktbh = [3]
            ywApi.getZyjdjd(params).then((res) => {
                console.log('getZyjdjd=', res)
                this.echart_zyjdjd_mcs = res.mcList
                this.echart_zyjdjd_counts = res.countList
                this.initCharts_zyjdjd()
                this.loading_zyjdjd = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_zyjdjd = false
            })
        },
        getZyajjd() {
            this.loading_zyajjd = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqj
            params.c_ktbh = [1]
            ywApi.getZyajjd(params).then((res) => {
                console.log('getZyajjd=', res)
                this.echart_zyajjd_mcs = res.mcList
                this.echart_zyajjd_counts = res.countList
                this.initCharts_zyajjd()
                this.loading_zyajjd = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_zyajjd = false
            })
        },
        //-----------------------------------------------------------------------------------------获取案件风险统计
        getAjfxtj_1() {
            this.loading_ajfxtj_1 = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqj
            params.c_ktbh = [1, 2, 3]
            ywApi.getAjfxtj_1(params).then((res) => {
                console.log('getAjfxtj_1=', res)
                this.echart_fxtj_1_mcs = res.mcList
                this.echart_fxtj_1_counts = res.countList
                this.initCharts_fxtj_1()
                this.loading_ajfxtj_1 = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_ajfxtj_1 = false
            })
        },
        getAjfxtj_2() {
            this.loading_ajfxtj_2 = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqj
            params.c_ktbh = [1, 2, 3]
            ywApi.getAjfxtj_2(params).then((res) => {
                console.log('getAjfxtj_2=', res)
                this.echart_fxtj_2_mcs = res.mcList
                this.echart_fxtj_2_counts = res.countList
                this.initCharts_fxtj_2()
                this.loading_ajfxtj_2 = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_ajfxtj_2 = false
            })
        },
        //-----------------------------------------------------------------------------------------获取立案均衡数据
        getLajhDatas() {
            this.loading_lajh = true
            var _this = this
            var params = {}
            params.tjqj = this.form.tjqj
            params.c_ktbh = [1, 2, 3]
            ywApi.getLajhDatas(params).then((res) => {
                console.log('getLajhDatas=', res)
                this.echart_lajh_times = res.times
                this.echart_lajh_counts = res.counts
                this.echart_lajh_datas = res.datas
                this.initChart_lajh()
                this.loading_lajh = false
            }).catch((err) => {
                this.$message({
                    type: 'error',
                    message: err
                })
                this.loading_lajh = false
            })
        },
        initChart_lajh() {
            var _this = this
            // 基于准备好的dom，初始化echarts实例
            this.echart_lajh = echarts.init(document.getElementById('echart_lajh'))

            // 绘制图表
            this.echart_lajh.setOption({
                backgroundColor: "transparent",
                tooltip: {
                    trigger: "axis",
                    axisPointer: {
                        type: "shadow",
                        textStyle: {
                            color: "#323232"
                        }
                    },
                },
                calculable: true,
                xAxis: [{
                    type: "category",
                    axisLine: {
                        lineStyle: {
                            color: "rgba(0,0,0,0.80)",
                            fontFamily: "PingFangSC-Regular",
                            fontsize: "12px",
                            fontWeight: "400"
                        }
                    },
                    splitLine: {
                        show: true
                    },
                    axisTick: {
                        show: true
                    },
                    data: this.echart_lajh_times,
                }],

                yAxis: [{
                    type: "value",
                    splitLine: {
                        show: true
                    },
                    axisLine: {
                        lineStyle: {
                            color: "rgba(0,0,0,0.80)",
                            fontFamily: "PingFangSC-Regular",
                            fontsize: "12px",
                            fontWeight: "400"
                        }
                    },

                }],
                legend: {
                    top: 'bottom',
                },
                series: [
                    {
                        name: "实际案件数量",
                        type: "line",
                        data: this.echart_lajh_counts,
                    },
                    {
                        name: "预测案件数量",
                        type: "line",
                        smooth: true, // 使线条平滑
                        lineStyle: {
                            type: 'dashed', // 设置为虚线
                            color: this.color_0
                        },
                        data: this.echart_lajh_datas[0],
                    },
                    {
                        name: "预测案件最低点",
                        type: "line",
                        smooth: true, // 使线条平滑
                        lineStyle: {
                            type: 'dashed', // 设置为虚线
                            color: this.color_1
                        },
                        data: this.echart_lajh_datas[1],
                    },
                    {
                        name: "预测案件最高点",
                        type: "line",
                        smooth: true, // 使线条平滑
                        lineStyle: {
                            type: 'dashed', // 设置为虚线
                            color: this.color_2
                        },
                        data: this.echart_lajh_datas[2],
                    },
                ]
            })
        },
        //-----------------------------------------------------------------------------------------初始化
        initDateStr() {
            var date = new Date()
            var year = date.getFullYear();
            var month = date.getMonth() + 1;
            var day = date.getDate();
            var hour = date.getHours();
            var min = date.getMinutes();
            var sec = date.getSeconds();
            month = month >= 10 ? month : ("0" + month);
            day = day >= 10 ? day : ("0" + day);
            this.form.tjqj = [year + "-" + month + "-" + '01', year + "-" + month + "-" + day]
            this.form.tjqjToday = [year + "-" + month + "-" + day, year + "-" + month + "-" + day]
        },
        selectDate() {
            if (this.form.tjqj == null || this.form.tjqj.length < 2) {
                return
            }
            if (this.form.tjqjHistory == this.form.tjqj) {
                return
            }
            this.form.tjqjHistory = this.form.tjqj
            this.initAll()
        },
        initAll() {
            //获取重大事件监督
            //this.getZdsjjdSum()
            //案件风险统计
            this.getAjfxtj_1()
            this.getAjfxtj_2()
            //重要案件监督
            this.getZyajjd()
            //重要节点监督
            this.getZyjdjd()
            //立案均衡
            this.getLajhDatas()
        },
        getJrzl() {
            this.getTodayAj()
            this.getTodayAj_g()
            this.getTodayAj_z()
            this.getTodayAj_d()
            //this.getTodayRy()
            //this.getTodayRy_g()
            //this.getTodayRy_z()
            //this.getTodayRy_d()
        }
    },
    mounted() {
        //页面尺寸改变
        this.reloadPage()
        this.initDateStr()
        //今日总览
        this.getJrzl()
    }
}
